import request from "../service";

//#region 用户模块
//用户列表
export function getUserList(pageIndex = 1, pageSize = 10) {
  return request({
    url: `/uesr/getUserList`,
    method: "post",
    data: {
      pageIndex,
      pageSize
    }
  });
}

//添加用户
export function addUserInfo(userInfo) {
  return request({
    url: `/user/addUser`,
    method: "post",
    data: {
      userInfo
    }
  });
}

//更新用户
export function updateUserInfo(userInfo) {
  return request({
    url: `/user/updateUser`,
    method: "post",
    data: {
      userInfo
    }
  });
}

//删除用户
export function delUserInfo(id) {
  return request({
    url: `/user/deleteUser`,
    method: "post",
    data: {
      id
    }
  });
}
//#endregion


//#region 学生模块
//列表
export function getStudentList(pageIndex = 1, pageSize = 10) {
  return request({
    url: `/user/student/getStudentList`,
    method: "post",
    data: {
      pageIndex,
      pageSize
    }
  });
}

//添加
export function addStudentInfo(studentInfo) {
  return request({
    url: `/Student/addStudent`,
    method: "post",
    data: {
      studentInfo
    }
  });
}

//更新
export function updateStudentInfo(studentInfo) {
  return request({
    url: `/user/updateUser`,
    method: "post",
    data: {
      studentInfo
    }
  });
}

//删除
export function delStudentInfo(id) {
  return request({
    url: `/user/deleteUser`,
    method: "post",
    data: {
      id
    }
  });
}
//#endregion

//#region 教师模块

//教师列表
export function getTeacherList(pageIndex = 1, pageSize = 10) {
  return request({
    url: `/user/teacher/getTeacherList`,
    method: "post",
    data: {
      pageIndex,
      pageSize
    }
  });
}

//添加
export function addTeacherInfo(teacherInfo) {
  return request({
    url: `/user/teacher/addTeacher`,
    method: "post",
    data: {
      teacherInfo
    }
  });
}

//更新
export function updateTeacherInfo(teacherInfo) {
  return request({
    url: `/user/teacher/updateTeacher`,
    method: "post",
    data: {
      teacherInfo
    }
  });
}

//删除
export function delTeacherInfo(id) {
  return request({
    url: `/user/teacher/deleteTeacher`,
    method: "post",
    data: {
      id
    }
  });
}

//#endregion









